import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'routes.dart';
import 'tapbox.dart';

final demos = AppRoutes.getDemos();


class APP extends StatefulWidget {

  @override
  State<StatefulWidget> createState() => new _APPState();
}


class _APPState extends State<APP> {
  @override
  Widget build(BuildContext context) {

    void _buttonClick() {
      setState(() {
        print("点击了按钮");
      });
    }

    return new Scaffold(
      appBar: new AppBar(
        centerTitle: true,
        title: new Text(
          '云钉绘途',
        style: new TextStyle(
          color: Colors.white,
        ),
        ),
      ),
      body: new Column(
        children: <Widget>[
          new Center(
            child: new Container (
              padding: const EdgeInsets.only(top: 80),
              child: new Image.asset("assets/images/yunding.png"),
            ),
          ),
          new Container(
            margin: EdgeInsets.only(top: 30),
            child: new CupertinoButton(
                color: Colors.blue,
                borderRadius: BorderRadius.all(Radius.circular(20.0)),
                child: new Container(
//                  padding: EdgeInsets.all(2),
                  width: 100,
                  height: 20,
                  child: new Text(
                      "点击下载",
                    style: new TextStyle(
                      color: Colors.white,
                      fontSize: 20,
                    ),
                    textAlign: TextAlign.center,
                  ),
                ),
                onPressed: _buttonClick),
          )
        ],

      ),
    );
  }

  Widget _getWidget(Map demo, BuildContext context) {
    return new GestureDetector(
      onTap: () {
        Navigator.pushNamed(context, demo['path']);
      },
      child: new Container(
        decoration: new BoxDecoration(
          color: Colors.white,
        ),
        alignment: Alignment.center,
        child: new Text(
          demo['name'],
          style: new TextStyle(
            fontSize: 18.0,
            fontWeight: FontWeight.w500,
          ),
        ),
      ),
    );
  }
}